from dask.dataframe.io.demo import names


class Person:
    def __init__(self,name,age,height):
        self.name = name
        self.age = age
        self.height = height


    def run(self):
        print(f'{self.name} 在 run')

    def eat(self):
        print('eat')

    def __str__(self):
        """
        重写str，打印对象得到的值，就是这个方法返回的值
        :return:
        """
        return self.name

    def __del__(self):
        print('对象将被销毁')



class Dog:
    def __init__(self,color,name):
        self.color = color
        self.name = name

    def bark(self):
        print('bark')

    def wag_tail(self):
        print('wag_tail')

#当实例化对象时，会把数据传进去
xiaoming = Person('小明',18,1.85)
xiaoming.run()

xiaohong = Person('小红',18,1.78)

print(id(xiaoming),id(xiaohong))

#is可以判断两个对象是否指向同一个空间

print(xiaoming)

a = [1,2,3]
del a
a

